-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize strings transformation #371
Conversation
… space normalization)
… space normalization)
…' into normalize-strings-transformation # Conflicts: # src/main/java/com/conveyal/datatools/manager/models/transform/NormalizeFieldTransformation.java # src/test/java/com/conveyal/datatools/manager/models/transform/NormalizeFieldTransformationTest.java
…, add cap exceptions.
…ialize excep/substitutions.
Codecov Report
@@ Coverage Diff @@
## dev #371 +/- ##
============================================
+ Coverage 26.61% 27.53% +0.92%
- Complexity 649 688 +39
============================================
Files 178 180 +2
Lines 9188 9354 +166
Branches 1243 1260 +17
============================================
+ Hits 2445 2576 +131
- Misses 6504 6533 +29
- Partials 239 245 +6
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
src/main/java/com/conveyal/datatools/manager/models/transform/TypedFeedTransformation.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I approve overall of this PR. However, I think we may want to rethink whether we should have the transform rules be a list within the FeedSource object. I think it deserves its own mongo collection because it is probably unnecessary to fetch all transformation data whenever a feed source is fetched. Also, it might also make sense to combine the FeedTransformRules
, FeedRetrievalMethod
and FeedTransformation
classes together into a single FeedTransformation
class. These design decisions were made prior to this PR, but I think moving forward, we should seriously consider refactoring this and avoid making additional lists within model classes unless a very small amount of data is expected within these lists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just seeing a failing build and my comment about a PR with a proposed refactor is now changing my mind to request changes.
…on-eas Combine TypedFeedTransformation and FeedTransformation
I have created issue #380 with your comments above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, but looks good.
|
||
@Override | ||
public void validateParameters(MonitorableJob.Status status) { | ||
// Does nothing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this method needed then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is needed because validateParameters
is now abstract in the parent class. Is @Override
needed though?
src/main/java/com/conveyal/datatools/manager/models/transform/NormalizeFieldTransformation.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Landon Reed <[email protected]>
src/main/java/com/conveyal/datatools/manager/models/transform/NormalizeFieldTransformation.java
Outdated
Show resolved
Hide resolved
…NormalizeFieldTransformation.java Co-authored-by: Landon Reed <[email protected]>
Checklist
dev
before they can be merged tomaster
)Description
This PR adds functionality for normalizing strings in a GTFS table:
In addition:
ZipTransform
andDbTransform
are refactored to pass the correctFeedTransformTarget
type to the implementersTwo optional configuration parameters are introduced:
DEFAULT_CAPITALIZATION_EXCEPTIONS
, a comma-separated list of words as they should appear after capitalization (acronyms, cardinal points)DEFAULT_SUBSTITUTIONS
, a comma-separated list of text and its replacement, in the formatold => new
, orold =>+ new
if space needs to be normalized aroundnew
.Things that have yet to be resolved:
NormalizeFieldTransformation
, is it important?gtfs.zip/google_transit/routes.txt